/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package websom;

import domain.Map;
import domain.NewsArticle;
import java.util.Random;

import java.util.logging.Level;
import java.util.logging.Logger;
import util.StringUtil;
import view.MainFrame;

/**
 *
 * @author Teddy
 */
public class Main {

    public Main() {
        try {
            Map map = new Map();
            
            System.out.println(Stopwords.getInstance().getStopwordsList().toString());
            ParserController.getInstance().init("reuters");
            long start = System.currentTimeMillis();
            for(NewsArticle newsArticle : ParserController.getInstance().getNewsArticles()){
//                System.out.println("----------------------------------------------------------------------------------");
//                System.out.println(newsArticle.getFileName());
//                System.out.println(newsArticle.toString());
//                System.out.println("----------------------------------------------------------------------------------");
             //    Dictionary.getInstance().addAll(newsArticle.getWords());
                map.getWNode(newsArticle).addNA(newsArticle);
            }
            double dist = ParserController.getInstance().getNewsArticles().get(2).distanta(ParserController.getInstance().getNewsArticles().get(5));
            new MainFrame(map);
            long end = System.currentTimeMillis();
        } catch (InterruptedException ex) {

            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
     
        
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        new Main();

        //de aici ma joc io cu elementele doar de test
        //se pot sterge
            /*  LinkedList<sommm.Element> lst= new LinkedList<sommm.Element>();
        sommm.Element tmpEl = new sommm.Element("el1");
        tmpEl.proc(" a b c f", 2);
        lst.add(tmpEl);
        tmpEl = new sommm.Element("el2");
        tmpEl.proc(" a a a b c f", 2);
        lst.add(tmpEl);
        tmpEl = new sommm.Element("el3");
        tmpEl.proc("  c f x y", 2);
        lst.add(tmpEl);
        tmpEl = new sommm.Element("el4");
        tmpEl.proc(" 1 2 3 3", 2);
        lst.add(tmpEl);
        for(sommm.Element el1:lst)
        {
        for(sommm.Element el2:lst)
        {
        System.out.println( el1.getNume()
        + " ...\t "
        + el2.getNume()
        + " = \t"  + el1.distanta(el2));
        }
        }
         */


    }
}
